package com;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@SuppressWarnings("serial")
@WebServlet("/DefineRuleServlet")
public class DefineRuleServlet extends HttpServlet{
	private RulesManager rulesManager = new RulesManager();
	
	protected void doPost(HttpServletRequest request, HttpServletResponse response){
		// Define a new rule
		rulesManager.defineRule(request, response);

		try {
			// Redirect the user to the Rules page
			response.sendRedirect("rules.jsp");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}